import { Button } from 'antd';
import { EModalType1, MODAL1_KEY } from '../../exports';
import { useMainModal } from '@hdtd/components/test';
import { useEffect, memo } from 'react';

const BB = ({ count, onClick }: { count: number; onClick?: () => void }) => {
  const [mOpen] = useMainModal(MODAL1_KEY) ?? [];
  useEffect(() => {
    return () => {
      console.log('卸载了BB');
    };
  }, []);
  return (
    <div>
      我是BB:{count}
      <Button onClick={onClick}>count++</Button>
      <Button onClick={() => mOpen?.(EModalType1.BB)}>打开BB1</Button>
    </div>
  );
};

export default memo(BB);
